package com.huawei.appgallery.forum.option.reply.view;

import android.os.Bundle;
import android.view.View;
import androidx.annotation.Nullable;
import com.huawei.appgallery.forum.base.ui.ForumActivity;
import com.huawei.appgallery.forum.option.api.ICommentReplyActivityProtocol;
import com.huawei.hmf.annotation.ActivityDefine;
import o.bqx;
import o.btb;
import o.byc.e;
import o.cbh;
import o.fho;
import o.fiu;
import o.fiv;
import o.fjb;
import o.fjo;
import o.fjq;

@ActivityDefine(alias = "option.reply.comment", protocol = ICommentReplyActivityProtocol.class)
public class CommentReplyTransgerActivity extends ForumActivity {
    private fiv ˋॱ = fiv.ॱ(this);

    public void onCreate(@Nullable Bundle bundle) {
        requestWindowFeature(1);
        super.onCreate(bundle);
        View view = new View(this);
        view.setAlpha(0.0f);
        setContentView(view);
        getWindow().setBackgroundDrawableResource(e.ʻ);
        ICommentReplyActivityProtocol iCommentReplyActivityProtocol = (ICommentReplyActivityProtocol) this.ˋॱ.ॱ();
        if (iCommentReplyActivityProtocol == null) {
            bqx.ॱ("CommentReplyTransgerActivity", "protocol is null!");
            finish();
        } else if (btb.ˊ(this, iCommentReplyActivityProtocol.getCommentStatus(), false)) {
            ˏ(iCommentReplyActivityProtocol);
        } else {
            finish();
        }
    }

    private void ˎ(ICommentReplyActivityProtocol iCommentReplyActivityProtocol) {
        fjb ˎ = fho.ˏ().ˋ("Option").ˎ("option.reply.comment.inner");
        ICommentReplyActivityProtocol iCommentReplyActivityProtocol2 = (ICommentReplyActivityProtocol) ˎ.ˊ();
        iCommentReplyActivityProtocol2.setPid(iCommentReplyActivityProtocol.getPid());
        iCommentReplyActivityProtocol2.setReplyId(iCommentReplyActivityProtocol.getReplyId());
        iCommentReplyActivityProtocol2.setType(iCommentReplyActivityProtocol.getType());
        iCommentReplyActivityProtocol2.setCommentId(iCommentReplyActivityProtocol.getCommentId());
        iCommentReplyActivityProtocol2.setToUid(iCommentReplyActivityProtocol.getToUid());
        iCommentReplyActivityProtocol2.setToUserName(iCommentReplyActivityProtocol.getToUserName());
        iCommentReplyActivityProtocol2.setDomainId(iCommentReplyActivityProtocol.getDomainId());
        iCommentReplyActivityProtocol2.setSectionId(iCommentReplyActivityProtocol.getSectionId());
        fiu.ˊ().ˏ(this, ˎ);
        finish();
    }

    private void ˏ(final ICommentReplyActivityProtocol iCommentReplyActivityProtocol) {
        ((cbh) fho.ˏ().ˋ("User").ॱ(cbh.class)).ˎ(this, 15).ˏ(new fjq<Boolean>(this) {
            final /* synthetic */ CommentReplyTransgerActivity ˊ;

            public void onComplete(fjo<Boolean> o_fjo_java_lang_Boolean) {
                if (o_fjo_java_lang_Boolean.ˊ() && ((Boolean) o_fjo_java_lang_Boolean.ॱ()).booleanValue()) {
                    this.ˊ.ˎ(iCommentReplyActivityProtocol);
                    return;
                }
                bqx.ˏ("CommentReplyTransgerActivity", "check user fail");
                this.ˊ.finish();
            }
        });
    }
}
